package com.spc.car.data.service.std.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spc.car.common.utils.StringUtils;
import com.spc.car.data.entity.std.StdFgExpertSpecialtyClassification;
import com.spc.car.data.mapper.std.StdFgExpertSpecialtyClassificationMapper;
import com.spc.car.data.service.std.StdFgExpertSpecialtyClassificationService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 发改委2018公共资源交易评标专家专业分类标准表
发改法规〔2018〕316号 服务实现类
 * </p>
 *
 * @author 
 * @since 2020-04-07
 */
@Service
public class StdFgExpertSpecialtyClassificationServiceImpl extends ServiceImpl<StdFgExpertSpecialtyClassificationMapper, StdFgExpertSpecialtyClassification> implements StdFgExpertSpecialtyClassificationService {

    @Override
    public List<StdFgExpertSpecialtyClassification> listBidClassificationByParentCode(String parentCode) {
        return list(new LambdaQueryWrapper<StdFgExpertSpecialtyClassification>()
                .eq(StringUtils.isNotBlank(parentCode), StdFgExpertSpecialtyClassification::getParentCode, parentCode)
                .isNull(StringUtils.isBlank(parentCode), StdFgExpertSpecialtyClassification::getParentCode)
                .orderByAsc(StdFgExpertSpecialtyClassification::getCode)
        );
    }
}
